﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using eeenno.ReaderEngine.Utilities;

namespace eeenno.SpeeedReaderUI.Forms
{
    public partial class SettingsAppearanceForm : Form
    {
        public SettingsAppearanceForm()
        {
            InitializeComponent();
            LoadSettings();
        }

        public void LoadSettings()
        {
            comboBox_page_size.Text = Settings.page_size + " Items";
            checkBox_show_progress.Checked = Settings.show_progress_bar;
            comboBox_item_size.SelectedIndex = Settings.item_size;
            checkBox_show_icons.Checked = Settings.show_icons;
            comboBox_theme.SelectedIndex = Settings.theme;
            checkBox_simple_lists.Checked = Settings.use_smaller_list_font;
        }       

        private void menuItem_save_Click_1(object sender, EventArgs e)
        {
            Settings.theme = comboBox_theme.SelectedIndex;
            Settings.page_size = int.Parse(comboBox_page_size.Text.Split(' ')[0]);
            Settings.show_progress_bar = checkBox_show_progress.Checked;
            Settings.item_size = comboBox_item_size.SelectedIndex;
            Settings.show_icons = checkBox_show_icons.Checked;
            Settings.use_smaller_list_font = checkBox_simple_lists.Checked;
            Settings.WriteSettings();
            DialogResult = DialogResult.OK;
        }

        private void menuItem1_cancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}